package com.cs.archivesmanagement.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

/**
 * Created by amo on 2015/8/21.
 */
@Entity
@Table(name = "am_department", schema = "", catalog = "csam")
public class AmDepartment {
    private int departmentId;
    private String departmentName;


    public AmDepartment(Integer departmentId){

        this.departmentId=departmentId;
    }

    public AmDepartment(){


    }




    @Id
    @Column(name = "Department_id", nullable = false, insertable = true, updatable = true)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    public int getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(int departmentId) {
        this.departmentId = departmentId;
    }

    @Basic
    @Column(name = "Department_name", nullable = true, insertable = true, updatable = true, length = 20)
    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AmDepartment that = (AmDepartment) o;

        if (departmentId != that.departmentId) return false;
        if (departmentName != null ? !departmentName.equals(that.departmentName) : that.departmentName != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = departmentId;
        result = 31 * result + (departmentName != null ? departmentName.hashCode() : 0);
        return result;
    }






}
